import {ConfigDataContextInterface} from "../../generate/entitas/ConfigDataContext";
import {Matcher} from "../../3rd/entitas";
import {ConfigDataCompIds, ConfigDataEntity} from "../../generate/entitas";
import {ComplexCompData, ComplexEntityIndex} from "../../3rd/entitas/EntiasIndex";

ConfigDataContextInterface.prototype.initExtension = function (){
	let group = context.getGroup(Matcher.allOf(	ConfigDataCompIds.Platform, ConfigDataCompIds.Export))
	let comp1 = new ComplexCompData()
	comp1.compType = ConfigDataCompIds.Export
	comp1.field = "value"
	let comp2 = new ComplexCompData()
	comp2.field = 'value'
	comp2.compType = ConfigDataCompIds.Platform
	let index = new ComplexEntityIndex(group, comp1, comp2)
	this._SheetNamePlatIndex = index
}

ConfigDataContextInterface.prototype.GetEntitiesByExportPlatformIndex= function (exportV,platform){
	return this._SheetNamePlatIndex.getEntities(exportV, platform)
}

interface IConfigDataContext {
	initExtension()
	GetEntitiesByExportPlatformIndex(exportV,platform) : Array<ConfigDataEntity>
	_SheetNamePlatIndex : ComplexEntityIndex

}